.class Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;
.super Ljava/lang/Object;
.source "DownloadDialog.java"

# interfaces
.implements Landroid/view/View$OnClickListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$1:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

.field final synthetic val$item:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;


# direct methods
.method constructor <init>(Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;)V
    .registers 3
    .param p1, "this$1"    # Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    .prologue
    .line 253
    iput-object p1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->this$1:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    iput-object p2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->val$item:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onClick(Landroid/view/View;)V
    .registers 7
    .param p1, "v"    # Landroid/view/View;

    .prologue
    .line 258
    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->this$1:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    iget-object v2, v2, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->this$0:Lcom/brixd/niceapp/activity/fragment/DownloadDialog;

    # getter for: Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mOnDownloadTypeClickEvent:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$OnDownloadTypeClickEvent;
    invoke-static {v2}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->access$100(Lcom/brixd/niceapp/activity/fragment/DownloadDialog;)Lcom/brixd/niceapp/activity/fragment/DownloadDialog$OnDownloadTypeClickEvent;

    move-result-object v2

    if-eqz v2, :cond_2b

    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->this$1:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    iget-object v2, v2, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->this$0:Lcom/brixd/niceapp/activity/fragment/DownloadDialog;

    # getter for: Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mOnDownloadTypeClickEvent:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$OnDownloadTypeClickEvent;
    invoke-static {v2}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->access$100(Lcom/brixd/niceapp/activity/fragment/DownloadDialog;)Lcom/brixd/niceapp/activity/fragment/DownloadDialog$OnDownloadTypeClickEvent;

    move-result-object v2

    iget-object v3, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->val$item:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;

    iget-object v3, v3, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->type:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadType;

    invoke-interface {v2, v3}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$OnDownloadTypeClickEvent;->onDownloadTypeClick(Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadType;)Z

    move-result v2

    if-nez v2, :cond_2b

    .line 259
    sget-object v2, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$1;->$SwitchMap$com$brixd$niceapp$activity$fragment$DownloadDialog$DownloadType:[I

    iget-object v3, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->val$item:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;

    iget-object v3, v3, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->type:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadType;

    invoke-virtual {v3}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadType;->ordinal()I

    move-result v3

    aget v2, v2, v3

    packed-switch v2, :pswitch_data_16e

    .line 308
    :cond_2b
    :goto_2b
    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->this$1:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    iget-object v2, v2, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->this$0:Lcom/brixd/niceapp/activity/fragment/DownloadDialog;

    invoke-virtual {v2}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->dismiss()V

    .line 309
    return-void

    .line 261
    :pswitch_33
    new-instance v0, Landroid/content/Intent;

    const-string v2, "android.intent.action.VIEW"

    invoke-direct {v0, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 262
    .local v0, "appIntent":Landroid/content/Intent;
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "market://details?id="

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget-object v3, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->this$1:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    iget-object v3, v3, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->this$0:Lcom/brixd/niceapp/activity/fragment/DownloadDialog;

    # getter for: Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mPackageName:Ljava/lang/String;
    invoke-static {v3}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->access$200(Lcom/brixd/niceapp/activity/fragment/DownloadDialog;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v2

    invoke-virtual {v0, v2}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;

    .line 263
    const-string v2, "com.android.vending"

    invoke-virtual {v0, v2}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;

    .line 265
    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->this$1:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    iget-object v2, v2, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->this$0:Lcom/brixd/niceapp/activity/fragment/DownloadDialog;

    invoke-virtual {v2}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-static {v2, v0}, Lcom/zuiapps/suite/utils/intent/IntentUtil;->isIntentAvailable(Landroid/content/Context;Landroid/content/Intent;)Z

    move-result v2

    if-eqz v2, :cond_7b

    .line 266
    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->this$1:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    iget-object v2, v2, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->this$0:Lcom/brixd/niceapp/activity/fragment/DownloadDialog;

    invoke-virtual {v2}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-virtual {v2, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    goto :goto_2b

    .line 268
    :cond_7b
    new-instance v1, Landroid/content/Intent;

    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->this$1:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    iget-object v2, v2, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->this$0:Lcom/brixd/niceapp/activity/fragment/DownloadDialog;

    invoke-virtual {v2}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getContext()Landroid/content/Context;

    move-result-object v2

    const-class v3, Lcom/brixd/niceapp/activity/WebViewActivity;

    invoke-direct {v1, v2, v3}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 269
    .local v1, "webIntent":Landroid/content/Intent;
    const-string v2, "URL"

    iget-object v3, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->val$item:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;

    iget-object v3, v3, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->url:Ljava/lang/String;

    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 270
    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->this$1:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    iget-object v2, v2, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->this$0:Lcom/brixd/niceapp/activity/fragment/DownloadDialog;

    invoke-virtual {v2}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-virtual {v2, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    goto :goto_2b

    .line 275
    .end local v0    # "appIntent":Landroid/content/Intent;
    .end local v1    # "webIntent":Landroid/content/Intent;
    :pswitch_9f
    new-instance v0, Landroid/content/Intent;

    const-string v2, "android.intent.action.VIEW"

    invoke-direct {v0, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 276
    .restart local v0    # "appIntent":Landroid/content/Intent;
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "market://details?id="

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget-object v3, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->this$1:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    iget-object v3, v3, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->this$0:Lcom/brixd/niceapp/activity/fragment/DownloadDialog;

    # getter for: Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mPackageName:Ljava/lang/String;
    invoke-static {v3}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->access$200(Lcom/brixd/niceapp/activity/fragment/DownloadDialog;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v2

    invoke-virtual {v0, v2}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;

    .line 277
    const-string v2, "com.wandoujia.phoenix2"

    invoke-virtual {v0, v2}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;

    .line 278
    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->this$1:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    iget-object v2, v2, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->this$0:Lcom/brixd/niceapp/activity/fragment/DownloadDialog;

    invoke-virtual {v2}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-static {v2, v0}, Lcom/zuiapps/suite/utils/intent/IntentUtil;->isIntentAvailable(Landroid/content/Context;Landroid/content/Intent;)Z

    move-result v2

    if-eqz v2, :cond_e8

    .line 279
    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->this$1:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    iget-object v2, v2, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->this$0:Lcom/brixd/niceapp/activity/fragment/DownloadDialog;

    invoke-virtual {v2}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-virtual {v2, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    goto/16 :goto_2b

    .line 281
    :cond_e8
    new-instance v1, Landroid/content/Intent;

    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->this$1:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    iget-object v2, v2, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->this$0:Lcom/brixd/niceapp/activity/fragment/DownloadDialog;

    invoke-virtual {v2}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getContext()Landroid/content/Context;

    move-result-object v2

    const-class v3, Lcom/brixd/niceapp/activity/WebViewActivity;

    invoke-direct {v1, v2, v3}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 282
    .restart local v1    # "webIntent":Landroid/content/Intent;
    const-string v2, "URL"

    iget-object v3, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->val$item:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;

    iget-object v3, v3, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->url:Ljava/lang/String;

    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 283
    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->this$1:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    iget-object v2, v2, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->this$0:Lcom/brixd/niceapp/activity/fragment/DownloadDialog;

    invoke-virtual {v2}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-virtual {v2, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    goto/16 :goto_2b

    .line 288
    .end local v0    # "appIntent":Landroid/content/Intent;
    .end local v1    # "webIntent":Landroid/content/Intent;
    :pswitch_10d
    new-instance v0, Landroid/content/Intent;

    const-string v2, "android.intent.action.VIEW"

    invoke-direct {v0, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 289
    .restart local v0    # "appIntent":Landroid/content/Intent;
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "market://details?id="

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget-object v3, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->this$1:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    iget-object v3, v3, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->this$0:Lcom/brixd/niceapp/activity/fragment/DownloadDialog;

    # getter for: Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mPackageName:Ljava/lang/String;
    invoke-static {v3}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->access$200(Lcom/brixd/niceapp/activity/fragment/DownloadDialog;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v2

    invoke-virtual {v0, v2}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;

    .line 290
    const-string v2, "com.xiaomi.market"

    invoke-virtual {v0, v2}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;

    .line 292
    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->this$1:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    iget-object v2, v2, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->this$0:Lcom/brixd/niceapp/activity/fragment/DownloadDialog;

    invoke-virtual {v2}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-static {v2, v0}, Lcom/zuiapps/suite/utils/intent/IntentUtil;->isIntentAvailable(Landroid/content/Context;Landroid/content/Intent;)Z

    move-result v2

    if-eqz v2, :cond_156

    .line 293
    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->this$1:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    iget-object v2, v2, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->this$0:Lcom/brixd/niceapp/activity/fragment/DownloadDialog;

    invoke-virtual {v2}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-virtual {v2, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    goto/16 :goto_2b

    .line 296
    :cond_156
    const-string v2, "Download from Xiaomi error."

    invoke-static {v2}, Lcom/zuiapps/suite/utils/log/LogUtil;->e(Ljava/lang/String;)V

    goto/16 :goto_2b

    .line 300
    .end local v0    # "appIntent":Landroid/content/Intent;
    :pswitch_15d
    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->this$1:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    iget-object v2, v2, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->this$0:Lcom/brixd/niceapp/activity/fragment/DownloadDialog;

    iget-object v3, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->val$item:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;

    iget-object v3, v3, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->url:Ljava/lang/String;

    iget-object v4, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;->val$item:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;

    iget v4, v4, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->appId:I

    # invokes: Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->directDownload(Ljava/lang/String;I)V
    invoke-static {v2, v3, v4}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->access$300(Lcom/brixd/niceapp/activity/fragment/DownloadDialog;Ljava/lang/String;I)V

    goto/16 :goto_2b

    .line 259
    :pswitch_data_16e
    .packed-switch 0x1
        :pswitch_33
        :pswitch_9f
        :pswitch_10d
        :pswitch_15d
    .end packed-switch
.end method
